const router = require('koa-router')()
const Mock = require('mockjs')
const { carList } = Mock.mock({
  "carList|5": [{
    "id": "@id",
    "image": "@image(150x120, @color, item)",
    "desc": "@cword(10, 20)",
    "title": "@ctitle",
    "price|100-500": 1,
    "dis": 0.9,
    "count|1-5": 1,
    "state": true
  }]
})

router.get('/list', ctx => {
  ctx.body = {
    code: 200,
    data: carList
  }
})

module.exports = router
